﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using VCN.App.DataTransferObjects;
using VCN.App.DataAccessLayer;

namespace VCN.home.UC
{
    public partial class NewsUC : System.Web.UI.UserControl
    {      
        protected void Page_Load(object sender, EventArgs e)
        {
            this.BindData();
        }

        private void BindData()
        {
            // Big Slide
            NewsDAO objNews = new NewsDAO();
            DataTable v_dt_list = objNews.SellectNewsTop();
            //rptClassifiesNews.DataSource = v_dt_list;
            //rptClassifiesNews.DataBind();
        }
        public string SubStringTrim(string ip_string)
        {
            if (ip_string.Length > 80)
                return ip_string.Substring(0, 80) + "...";
            return ip_string;
        }
        public string SubTitleTrim(string ip_string)
        {
            if (ip_string.Length > 45)
                return ip_string.Substring(0, 45) + "...";
            return ip_string;
        }
        public string standardLink(string ip_id, string ip_name)
        {
            return string.Format("/news/{0}/{1}.html", ip_id,ip_name);
        }        
    }
}